package com.wave.wavesystem.common.util;


import wave.common.exception.WaveBusinessException;
import wave.common.pojo.enums.RStatusEnum;

/**
 * @author 夕下风波
 * @date 2025-02-02 22:37
 * @description 异常抛出工具类
 */
public class ThrowUtil {

    public static void throwIf(boolean condition) {
        if (condition) throw new WaveBusinessException();
    }

    public static void throwIf(boolean condition, String message) {
        if (condition) throw new WaveBusinessException(message);
    }

    public static void throwIf(boolean condition, RStatusEnum status) {
        if (condition) throw new WaveBusinessException(status);
    }

    public static void throwIf(boolean condition, RStatusEnum status, String message) {
        if (condition) throw new WaveBusinessException(status, message);
    }

}
